-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--[[

    挖坟

]]--
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


AddPrefabPostInit(
    "mound",
    function(inst)
        if not TheWorld.ismastersim then
            return
        end

        if inst.components.workable == nil then
            return
        end

        local old_WorkedBy = inst.components.workable.WorkedBy
        inst.components.workable.WorkedBy = function(self, worker,...)
            if worker and worker:HasTag("hutao") and worker.components.hutao_com_dialogue then
                worker.components.hutao_com_dialogue:Say("mound_dig_failed",1)
                return
            end
            return old_WorkedBy(self, worker,...)
        end

        local old_WorkedBy_Internal = inst.components.workable.WorkedBy_Internal
        inst.components.workable.WorkedBy_Internal = function(self, worker,...)
            if worker and worker:HasTag("hutao") and worker.components.hutao_com_dialogue then
                worker.components.hutao_com_dialogue:Say("mound_dig_failed",1)
                return
            end
            return old_WorkedBy_Internal(self, worker,...)
        end
        
    end
)


